<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html">

<h:head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
	<title>PetStore UOC - Practical Case</title>
</h:head>

<h:body>
<h:panelGroup rendered="#{!empty customerLogin.dataCustomer.name}">
	<h:form>
	<h:outputText value="Wellcome "/>
	<h:link outcome="clientDetailView" value="#{customerLogin.dataCustomer.name}"/>
	<br />
	<h:link outcome="showShoppingCartView" value="View shopping cart"/>
	<br />
	<br />
		<h:commandButton value="Logout" action="#{customerLogin.logoutMBean}"/>
	</h:form>
</h:panelGroup>
<h:panelGroup rendered="#{empty customerLogin.dataCustomer.name}">
	<h:form>
	 	<h:outputText value="E-mail:"/>
	 	<h:inputText id="customerEmail" value="#{customerLogin.dataCustomer.email}" required="true"/>
	 	<br />
	 	<h:outputText value="Password:"/>
	 	<h:inputSecret id="customerPassword" value="#{customerLogin.dataCustomer.password}" required="true"/>
	 	<br />
	 	<h:commandButton value="Login" action="#{customerLogin.loginMBean}"/>
	 </h:form>
	 <h:link outcome="modifyClientView" value="Click here to register.">
	 	<f:param name="nifCustomer" value="#{customerLogin.dataCustomer.nif}"/>
	 </h:link>
</h:panelGroup>
</h:body>
</html>
